# -*- coding: utf-8 -*-

import os.path

from django.utils.translation import ugettext as _

# Django settings for estudent project.
# Only GLOBAL settings are here!

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    ('Gregor Kališnik', 'g@jst.sm'),
    ('Matej Jakop', 'matej@jakop.si'),
)

MANAGERS = ADMINS

# Define database in your own local settings file
# see settings_production.py for a template
#DATABASES = {
#    'default': {
#        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
#        'NAME': '',                      # Or path to database file if using sqlite3.
#        'USER': '',                      # Not used with sqlite3.
#        'PASSWORD': '',                  # Not used with sqlite3.
#        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
#        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
#    }
#}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Ljubljana'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'sl-si'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = False

DATE_FORMAT = 'd. m. Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = DATE_FORMAT + ', ' + TIME_FORMAT
DATE_INPUT_FORMATS = (
  '%d. %m. %Y',
  '%d.%m.%Y',
  '%Y-%m-%d',
  '%m/%d/%Y',
  '%m/%d/%y',
  '%b %d %Y',
  '%b %d, %Y',
  '%d %b %Y',
  '%d %b, %Y',
  '%B %d %Y',
  '%B %d, %Y',
  '%d %B %Y',
  '%d %B, %Y',
)

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
# Define your own!
#MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "media")

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/admin/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'k***rsc@oitt2a=(thfw@gr6v!=8=b-0d&f0_kj-1v8^d9s^m)'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.contrib.messages.context_processors.messages",
    'django.core.context_processors.request',
)

MIDDLEWARE_CLASSES = (
    'core.middleware.PrintingMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'axes.middleware.FailedLoginMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'yaes.urls'

# Define your own
#TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
#  './templates/'
#)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    # For some fancy security stuff
    'axes',
    # Fancy forms
    'form_utils',
    # Our apps
    'core',
    'student',
    'exams',
)

AUTH_PROFILE_MODULE = 'core.Profile'

# Default login redirect
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/login/'
LOGOUT_URL = '/logout/'

# Groups mapping
GROUPS = {
  'professors': 1,
  'clerks': 2,
  'dean': 3,
  'students': 4
}

# Settings for serializator
SERIALIZATION_MODULES = {
    'json': 'wadofstuff.django.serializers.json'
}

AXES_LOCKOUT_TEMPLATE = 'core/lockout.htm'

# Used for enrollment sheet, using slovenian terms (untranslatable)
SPECIAL_NEEDS = (
  ('A', 'A - Slepi / slabovidni'),
  ('B', 'B - Gluhi / naglušni'),
  ('C', 'C - Gibalno ovirani / invalidi'),
  ('D', 'D - Drugo'),
)
STUDY_TYPES = (
  ('J', 'J - Visokošolski strokovni'),
  ('K', 'K - Univerzitetni'),
  ('L', 'L - Magistrski'),
  ('N', 'N - Enovit magistrski'),
  ('M', 'M - Doktorski'),
  ('B', 'B - Visokošolski strokovni'),
  ('C', 'C - Univerzitetni'),
  ('E', 'E - Specialistični'),
  ('F', 'F - Magistrski'),
  ('G', 'G - Doktorski'),
  ('H', 'H - Enovit doktorski'),
)
ENROLLMENT_TYPES = (
  ('V1', 'V1 - Prvi vpis v letnik'),
  ('V2', 'V2 - Ponavljanje letnika'),
  ('V3', 'V3 - Nadaljevanje letnika'),
  ('AB', 'AB - Absolvent'),
  ('EV', 'EV - Evidenčni vpis'),
)
STUDENT_YEARS = (
  ('1', '1'),
  ('2', '2'),
  ('3', '3'),
  ('4', '4'),
  ('5', '5'),
  ('6', '6'),
  ('7', '7 - absolvent visokošolskega strokovnega študija'),
  ('8', '8 - absolvent univerzitetnega študija'),
  ('9', '9 - absolvent magistrskega študija'),
)

RATE_TYPES = (
  ('OC1','Ocena izpita in vaj'),
  ('OC2','Ocena vaj'),
  ('OC3','Ocena izpita')
)

VALID_GRADE_RANGE = (0, 10)
VALID_POINTS_RANGE = (0, 100)

POSITIVE_GRADE_BOUNDARY = 6
# Temporarily hardcoding
INSTITUTIONS = (
  ('163', 'Fakulteta za računalništvo in informatiko, Ljubljana'),
)

STUDY_OPTIONS = [
    ('0','Ne glede'),
    ('1', 'Redni vpis'),
    ('2', 'Izredni vpis')
]